import be.beeworks.scrumblebee.*

class BootStrap {


     def init = { servletContext ->
         def jlust = new Person(username: "jlust", userRealName: "Jurgen Lust", email: "Jurgen.Lust@gmail.com", passwd: "secret").save()
         def rfederer = new Person(username: "rfederer", userRealName: "Roger Federer", email: "Roger@Federer.com", passwd: "secret").save()
         def jkirk = new Person(username: "jkirk", userRealName: "James T. Kirk", email: "kirk@starfleet.org", passwd: "secret").save()

         def backlog1 = new Backlog().save()
         def product1 = new Product(code: "SB", name: "ScrumbleBee", description: "Scrum PM tool", backlog: backlog1, owner: jlust, scrumMaster: jkirk, dateCreated: new Date(), lastUpdate: new Date()).save()

         def pigs1 = new Team(role: Team.PIG, name: "ScrumbleBee pigs").save()
         pigs1.addToMembers(jkirk)
         pigs1.addToMembers(rfederer)
         product1.addToTeams(pigs1)
         def chickens1 = new Team(role: Team.CHICKEN, name: "ScrumbleBee chickens").save()
         chickens1.addToMembers(jlust)
         product1.addToTeams(chickens1)
     }
     def destroy = {
     }
} 